<?php     
    $categoryList = $this->categoryList;  
    $searchCond = $this->searchCond;
?>
        <div class="float-left" style="width:180px; margin-right:10px;">
            <div class="boxed">
                <a href="/event/edit" class="button green medium" style="width:138px;">Tạo sự kiện mới</a>
                <div class="clearThis"></div>
            </div>
            <!--Start: box Chuyên mục-->
            <div class="boxed">
                <div class="boxTop border-radius-top">
                    <div class="boxName"><h4>Chuyên mục sự kiện</h4></div>
                </div>
                <div class="boxBody menu border-radius-bottom">
                   <span class="event-tatCa"><a href="/event/cat" <?php if($this->termIdx==0)echo "class='bold'";?>>Tất cả</a></span>
                    <?php 
                    if(is_array($this->termList) && count($this->termList) > 0){
                        foreach($this->termList as $term){
                        ?>
                        <span class="event-lv2"><a href="/event/cat/<?=$term->tid;?>" <?php if($this->termIdx==$term->tid)echo "class='bold'";?>><?php echo $term->name;?></a></span>
                        <?php 
                        }
                    }
                    
                    ?>
                    <div class="clearThis"> </div>
                </div>
            </div>
            <!--End: box Chuyên mục-->
<?if($this->action!="search"){?>
            <!--start: box tìm kiếm-->
            <div class="boxed box-search category-search">
                <div class="boxTop border-radius-top">
                    <div class="boxName"><img style="margin-top:4px;" src="<?php echo EVENT_STATIC_SERVER;?>/assets/images/icons/spacer.gif" width="18" height="18" alt="cuoc song" class="icon_Event icon_timKiem" /><h4>Tìm kiếm</h4></div>
                </div>
                <div class="boxBody border-radius-bottom">
                <form action="/event/search" method="post">
                    <p>
                        <span>Từ khoá</span>
                        <input type="text" name="keyword" value="<?php echo $searchCond['keyword'];?>" id="keyword" class="inputEvent"/>
                    </p>
                    <p>
                        <span>Chuyên mục</span>
                                <select name="cid" id="cid" class="selectMedium">
                                    <option value="0">Tất cả</option>
                                <?php 
                                for($i=0; $i<count($categoryList); $i++){
                                    $category = $categoryList[$i];
                                ?>
                                    <option value="<?php echo $category->tid;?>"<?php if($searchCond['cid']==$category->tid) echo " selected=\"selected\"";?>><?php echo $category->name;?></option>
                                <?php 
                                }
                                
                                ?>
                                </select>
                    </p>
                    <p>
                        <span>Cộng đồng</span> <span id="nw_name"></span>
                        <script type="text/javascript">
                            $(document).ready(function() {
                                $("#various3").fancybox({
                                    'width'                : '75%',
                                    'height'            : '75%',
                                    'autoScale'            : false,
                                    'transitionIn'        : 'none',
                                    'transitionOut'        : 'none',
                                    'type'                : 'iframe'
                                });


                            });
                        </script>
                        <a id="various3" href="/event/network/1" class="chon-cong-dong">Chọn cộng đồng</a>
                        <input type="hidden" id="nwid" name="nwid">
                    </p>
                    <p>
                        <span>Ngày bắt đầu</span>   
                        <input type="text" name="start_time" id="start_time" value="<?php echo $searchCond['start_time'];?>"  class="inputEvent" size="3" />
                        <i id="start_time_trigger" class="ico-tool ico-img ico-datetime" style="cursor:pointer;"></i>
                        <script type="text/javascript">
                                  new Calendar({
                                          inputField: "start_time",
                                          dateFormat: "%d/%m/%Y",
                                          trigger: "start_time_trigger",
                                          bottomBar: false,
                                          onSelect: function() {
                                                  var date = Calendar.intToDate(this.selection.get());
                                                  LEFT_CAL.args.min = date;
                                                  LEFT_CAL.redraw();
                                                  this.hide();
                                          }
                                  });
                                </script>
                    </p>
                    <p>
                        <span>Ngày kết thúc</span>
                        <input type="text" name="end_time" id="end_time" value="<?php echo $searchCond['end_time'];?>" class="inputEvent" style="width:70px;" />            
                        <i id="end_time_trigger" class="ico-tool ico-img ico-datetime" style="cursor:pointer;"></i>  
                                <script type="text/javascript">
                                  new Calendar({
                                          inputField: "end_time",
                                          dateFormat: "%d/%m/%Y",
                                          trigger: "end_time_trigger",
                                          bottomBar: false,
                                          onSelect: function() {
                                                  var date = Calendar.intToDate(this.selection.get());
                                                  LEFT_CAL.args.min = date;
                                                  LEFT_CAL.redraw();
                                                  this.hide();
                                          }
                                  });
                                </script>

                    </p>
                    <p>
                        <button type="submit">Tìm sự kiện</button>
                    </p>
                </form>
                </div>
            </div>
            <!--End: box tìm kiếm-->
<?}?>
        </div>